import React, { Component } from 'react'
import {connect} from 'react-redux'
import   UserList from '../../components/UserList/UserList'

import {getUserList} from '../../redux/actions'

// boss界面容器组件
class Boss extends Component {
  // 生命周期钩子函数  发送ajax
  componentDidMount(){
    // boss 界面获取 dashen列表信息
    this.props.getUserList('dashen')
  }
  render () {
    
    return (
      // boss页面主页应该 显示的是大神dashen列表
      <div>
       {/*渲染用户列表*/}
        <UserList userList={this.props.userList} />
      </div>
    )
  }
}

export default connect(
  // state 注入 userList
  state => ({userList:state.userList}),
  // action
  {getUserList}
)(Boss)